package ying.sms;

import java.time.LocalDate;

/**
 * ClassName: Student
 * Package: sms
 * Description:
 *
 * @Author 刘英杰
 * @Create 2024/5/17 18:51
 * @Version 1.0
 */
public class Student {
    private Integer id;
    private String name;
    private Integer chineseScore;
    private Integer mathScore;

    private LocalDate enrollmentDates;

    private String emal;



    public String getEmal() {
        return emal;
    }

    public void setEmal(String emal) {
        this.emal = emal;
    }

    public LocalDate getEnrollmentDates() {
        return enrollmentDates;
    }

    public void setEnrollmentDates(LocalDate enrollmentDates) {
        this.enrollmentDates = enrollmentDates;
    }

    public Student(Integer id, String name, Integer chineseScore, Integer mathScore,
                   LocalDate enrollmentDates, String emal) {
        this(id,name,chineseScore,mathScore,enrollmentDates);
        this.emal = emal;
    }

    public Student(Integer id, String name, Integer chineseScore, Integer mathScore,
                   LocalDate enrollmentDates) {
        this.id = id;
        this.name = name;
        this.chineseScore = chineseScore;
        this.mathScore = mathScore;
        this.enrollmentDates = enrollmentDates;
    }

    public Student(Integer id, String name, Integer chineseScore, Integer mathScore) {
        this(id,name,chineseScore,mathScore,LocalDate.now());
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getChineseScore() {
        return chineseScore;
    }

    public void setChineseScore(Integer chineseScore) {
        this.chineseScore = chineseScore;
    }

    public Integer getMathScore() {
        return mathScore;
    }

    public void setMathScore(Integer mathScore) {
        this.mathScore = mathScore;
    }

    public Integer getTotolScore(){
        return chineseScore + mathScore;
    }

    public String toString(){
        return id + " " + name + " " + chineseScore + " " + mathScore + " " + " " +
                getEmal() + " " + getEnrollmentDates() + " " + getTotolScore();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Student student = (Student) o;

        return name.equals(student.name);
    }


}
